import os, ConfigParser
config = ConfigParser.ConfigParser()
p = os.path.dirname(__file__)
config.read(os.path.join(p, 'heibertsrpg.conf'))
preferences='Prefs'
info = 'Info'

def getName():
    if config.has_option(info, 'name'):
        name = config.get(info, 'name')
    else:
        name="Heibert's RPG"
    return name

def getAuthor():
    if config.has_option(info, 'author'):
        version = config.get(info, 'author')
    else:
        version = 'anonymous'
    return version

def getCurScreen():
    if config.has_option(preferences, 'curscreen'):
        curscreen = config.get(preferences, 'curscreen')
    else:
        curscreen = '0'
    return int(curscreen)
def getVersion():
    if config.has_option(info, 'version'):
        version = config.get(info, 'version')
    else:
        version = 'noversion?'
    return version

def getWidth():
    if config.has_option(preferences, 'width'):
        width = int(config.get(preferences, 'width'))
    else:
        width = 600
    return width

def getHeight():
    if config.has_option(preferences, 'Height'):
        height = int(config.get(preferences, 'Height'))
    else:
        height = 600
    return height